﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MyDBUtil;
using System.Data.Common;
using System.Data;

namespace MyWeb
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string sql = string.Format(@"INSERT INTO [myhc].[dbo].[Sys_User]
           ([username]
           ,[userpass]
           ,[truename]
           ,[usertel]
           ,[bid]
           ,[isadvisor]
           ,[isbranch]
           ,[rid]
           ,[state]
           ,[sign1]
           ,[sign2]
           ,[sign3])
     VALUES
           ('test'
           ,'test'
           ,'test'
           ,'test'
           ,'test'
           ,0
           ,0
           ,0
           ,0
           ,'test'
           ,'test'
           ,'test') select @@identity");
                DBHelper db = new DBHelper();
                DbCommand cmd = db.GetSqlStringCommond(sql);
                object obj = db.ExecuteScalar(cmd);
            }
        }
    }
}